<template>
	<view class="article">
		<uv-navbar leftIcon="arrow-leftward" leftIconColor="#FFF" placeholder autoBack bgColor="#161714">
			<template v-slot:center>
				<view class="center_slot">{{title}}</view>
			</template>
		</uv-navbar>
		<view class="parse_view">
			<uv-parse :content="content" />
		</view>
	</view>
</template>

<script setup>
	import {
		setting
	} from "@/request/api";
	import {
		onLoad
	} from "@dcloudio/uni-app";
	import {
		ref
	} from 'vue';

	const title = ref("");
	const content = ref("");
	const text = {
		use_provision: "使用条款",
		privacy: "隐私协议",
		common_question: "常见问题"
	};
	onLoad(async ({
		key
	}) => {
		title.value = text[key];
		let {
			data
		} = await setting({
			key
		});
		content.value = data?.content;
	});
</script>

<style scoped lang="scss">
	.article {
		min-height: 100vh;

		.center_slot {
			color: #FFFFFF;
			font-size: 14px;
			font-weight: 800;
		}

		.parse_view {
			color: #999999;
			font-size: 26rpx;
			font-weight: 500;
			padding: 50rpx 50rpx 0;
			box-sizing: border-box;
		}
	}
</style>